<% if current_user %>
  <nav class="rg-sidebar">
    <ul class="rg-sidebar-nav">
      <li>
        <%= link_to home_dashboard_index_path, class: "#{controller_name == 'dashboard' ? 'active' : ''}" do %>
          <i class="bi bi-speedometer2"></i>
          <span>Dashboard</span>
        <% end %>
      </li>

      <% if is_admin? %>
        <li class="mt-3">
          <div class="px-4 py-2 text-white-50 text-uppercase small fw-bold">Admin</div>
        </li>
        <li>
          <%= link_to admin_dashboard_path(admin_id: "1"), class: "#{controller_name == 'admin' && action_name == 'dashboard' ? 'active' : ''}" do %>
            <i class="bi bi-people"></i>
            <span>Manage Users</span>
          <% end %>
        </li>
        <li>
          <%= link_to admin_analytics_path(admin_id: "1"), class: "#{controller_name == 'admin' && action_name == 'analytics' ? 'active' : ''}" do %>
            <i class="bi bi-graph-up"></i>
            <span>View Analytics</span>
          <% end %>
        </li>
      <% end %>

      <li class="mt-3">
        <div class="px-4 py-2 text-white-50 text-uppercase small fw-bold">Employee</div>
      </li>

      <li>
        <%= link_to user_benefit_forms_path(user_id: current_user.id), class: "#{controller_name == 'benefit_forms' ? 'active' : ''}" do %>
          <i class="bi bi-file-earmark-text"></i>
          <span>Benefit Forms</span>
        <% end %>
      </li>

      <li>
        <%= link_to user_retirement_index_path(user_id: current_user.id), class: "#{controller_name == 'retirement' ? 'active' : ''}" do %>
          <i class="bi bi-piggy-bank"></i>
          <span>401k Info</span>
        <% end %>
      </li>

      <li>
        <%= link_to user_paid_time_off_index_path(user_id: current_user.id), class: "#{controller_name == 'paid_time_off' ? 'active' : ''}" do %>
          <i class="bi bi-calendar-check"></i>
          <span>PTO</span>
        <% end %>
      </li>

      <li>
        <%= link_to user_work_info_index_path(user_id: current_user.id), class: "#{controller_name == 'work_info' ? 'active' : ''}" do %>
          <i class="bi bi-briefcase"></i>
          <span>Work Info</span>
        <% end %>
      </li>

      <li>
        <%= link_to user_performance_index_path(user_id: current_user.id), class: "#{controller_name == 'performance' ? 'active' : ''}" do %>
          <i class="bi bi-bar-chart"></i>
          <span>Performance</span>
        <% end %>
      </li>

      <li>
        <%= link_to user_messages_path(user_id: current_user.id), class: "#{controller_name == 'messages' ? 'active' : ''}" do %>
          <i class="bi bi-envelope"></i>
          <span>Messages</span>
        <% end %>
      </li>

      <li>
        <%= link_to user_pay_index_path(user_id: current_user.id), class: "#{controller_name == 'pay' ? 'active' : ''}" do %>
          <i class="bi bi-credit-card"></i>
          <span>Pay</span>
        <% end %>
      </li>

      <li class="mt-4 pt-4 border-top border-secondary">
        <div class="px-4 py-2 text-white-50 small">
          <i class="bi bi-shield-exclamation"></i>
          OWASP RailsGoat <%= Rails::VERSION::STRING %>
        </div>
      </li>
    </ul>
  </nav>
<% end %>
